<template>
  <div id="bottomRight">
    <div class="bg-color-black">
      <div class="d-flex pt-2 pl-2">
        <span>
          <icon name="chart-area" class="text-icon"></icon>
        </span>
        <div class="d-flex">
          <span class="fs-xl text mx-2" style="font-size: 16px;">汽车排行榜Top30</span>
          <div class="decoration2">
            <dv-decoration-2 :reverse="true" style="width:5px;height:6rem;" />
          </div>
        </div>
      </div>
      <div class="row_list">
        <ul class="car_rank" style="width: 100%; height: 420px; overflow: auto;">
          <li class="title" style="font-size: 20px; background: rgb(83, 83, 253);">
            <div>销售排名</div>
            <div>图片</div>
            <div>汽车信息</div>
            <div>销售价格</div>
            <div>销售趋势</div>
            <div>保修时间</div>
            <div>上市时间</div>
          </li>
          <li v-for="car in carinfo_list" :key="car.car_name">
            <div style="line-height: 100px; font-weight: bold;">{{ car.rank }}</div>
            <div><img :src="car.car_img" alt="" style="height: 100%; width: 100%;"></div>
            <div style="font-weight: bold; margin-top: 20px;">
              <p>{{ car.car_name }}</p>
              <p>{{ car.brand_name }}/{{ car.manufacturer }}</p>
            </div>
            <div class="dataformat">{{ car.price }}</div>
            <div class="dataformat">{{ car.count }}</div>
            <div class="dataformat">{{ car.warrantyPeriod }}</div>
            <div class="dataformat">{{ car.marketTime }}</div>
          </li>
        </ul>
      </div>
    </div>
  </div>
</template>

<script>
import http from '../axios/http';
export default {
  data () {
    return {
      carinfo_list: ""
    }
  },
  mounted () {
    this.get_carInfo();
  },
  methods:{
    get_carInfo(){
      http.get('/largescreen/bottomright/').then(response=>{
        this.carinfo_list = response.data.carinfo_list.splice(0,30)
      }).catch(error=>{
        console.log(error)
      })
    }
  }
};
</script>

<style lang="scss" class>
$box-height: 520px;
$box-width: 100%;

#bottomRight {
  padding: 14px 16px;
  height: $box-height;
  width: $box-width;
  border-radius: 5px;

  .bg-color-black {
    height: $box-height - 30px;
    border-radius: 10px;
  }

  .text {
    color: #c3cbde;
  }

  //下滑线动态
  .decoration2 {
    position: absolute;
    right: 0.125rem;
  }

  .chart-box {
    margin-top: 16px;
    width: 170px;
    height: 170px;

    .active-ring-name {
      padding-top: 10px;
    }
  }

  //定义的样式
  .row_list {
    list-style: none;

    .car_rank::-webkit-scrollbar {
      display: none;
    }
    .car_rank .titleli::-webkit-scrollbar {
      display: inline-block;
    }

    .car_rank li {
      display: grid;
      -ms-grid-columns: 100px 150px 180px 120px 120px 110px 100px;
      grid-template-columns: 100px 150px 180px 120px 120px 110px 100px;
      cursor: pointer;
      margin-left: 23px;
      text-align: center;
      line-height: 30px;
    }
    .title div {
      font-weight: bold;
    }
    .dataformat {
      line-height: 100px;
      font-weight: bold;
    }
  }
}
</style>